<?php
	function verify_login($username, $passwd){
		$search = "SELECT * FROM Users WHERE username='$username';";
		$result = mysql_query($search);
		while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
			if($row['username']==$username && $row['passwd']==$passwd){
				session_start();
				$_SESSION['username']=$username;
				$_SESSION['passwd']=$passwd;
				if($row['isAdmin']=='true'){
					$_SESSION['isAdmin']=TRUE;
					header("Location: admin_dashboard.php");
					return TRUE;
				}else{
					$_SESSION['isAdmin']=FALSE;
					header("Location: user_dashboard.php");
					return TRUE;
				}
			}
		}
		header("Location: login.php");
		return FALSE;
	}
;?>